|
|
Thorsten Froehlich wrote:
> Well, it certainly is given how the code is separated into a frontend and
> backend. It also certainly is not trivial to understand. In short the
> frontend is pure C++ while the backend has to suit C. If you would check,
> you would find that povray_exit is only called with three different
> parameters (0, 1, 2) in four places. Two signals a user about, one an
> error.
>
I see. At least that's a clear and resonable decision.
> So all you need to do if you desire a return value for a
> command-line version (for a GUI version it does not matter) returned via
> main, you either exit directly (the default macro implementation), or, if
> you desire to perform proper cleanup (and displaying all other messages) you
> simply return -n via the longjmp and return that. No adding of some magic
> values.
>
Well, at least the "magic number 1" needs to be added since longjmp cannot
be used to return the value 0. This is because 0 is used as setjmp return
value to indicate direct return (i.e. not due to a call to longjmp).
-------<manual>-------
longjmp() cannot cause 0 to be returned. If longjmp is invoked with a
second argument of 0, 1 will be returned instead.
-----------------------
Wolfgang
Post a reply to this message
|
|